package com.meshnetics.gb.util.formatters;

import java.math.BigInteger;
import java.nio.ByteBuffer;

/**
 * @author Pavlov Dmitry dpavlov@meshnetics.com
 */
final class NumberFormatterULong implements NumberFormatter{

    public NumberFormatterULong(){
        
    }

    public String formatNumber(final long value) {
        ByteBuffer bb = ByteBuffer.allocate(8);
        bb.putLong(value);
        BigInteger i = new BigInteger(1,bb.array());        
        return new StringBuffer(i.toString()).append(" (").
                append(BufferFormatters.HEX_NUMBER.format(bb)).append(")").toString();
    }
}
